<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>登录</title>
    <style>
        .success {
            color: green;
            margin: 10px 0;
        }
        .error {
            color: red;
            margin: 10px 0;
        }
    </style>
</head>
<body>
<h2>请登录</h2>

<!-- Success Message -->
<div th:if="${successMessage}" class="success">
    <p th:text="${successMessage}"></p>
</div>

<div th:if="${param.error}" class="error">
    用户名或密码错误
</div>

<form th:action="@{/login}" method="post">
    <div>
        <label>用户名：</label>
        <input type="text" name="username" required/>
    </div>
    <div>
        <label>密码：</label>
        <input type="password" name="password" required/>
    </div>
    <div>
        <input type="submit" value="登录"/>
    </div>
</form>
<div>
    <a th:href="@{/user/create}">注册新用户</a>
</div>
</body>
</html>